import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPanel;
import javax.swing.ImageIcon;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
import java.util.Date;
import java.util.Calendar;

public class managerInterface extends JFrame implements ActionListener
{
  private JButton generate = new JButton("Generate a new timetable");
  private JButton managerView = new JButton("View timetable");
  private JButton back = new JButton("Back");
  private Container content4;
  
  // Construct a new window
  public managerInterface()
  {
    content4 = getContentPane();
    setTitle("Manager interface");
    content4.setLayout(new GridLayout(0, 1));
    content4.add(new JLabel("Hello, manager"));
    
    content4.add(new JLabel("What do you want to do?                          "));
    // create a new button and add it to the contents
    content4.add(generate);
    generate.addActionListener(this);
    // add in the contents a textlabel 
    content4.add(managerView);
    managerView.addActionListener(this);
    
    content4.add(back);
    back.addActionListener(this);
    // display the result in the restultextfield
    //  contents.add(resultJTextField);
    // exit the program in case the window it's closed
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    pack();
  }
  
  private Roster first;
  private MViewInterface second;
  private iniInterface ini;
  public void actionPerformed(ActionEvent event)
  {
    if (event.getSource() == generate)
    {
      dispose();
      first = new Roster();
      first.setVisible(true);
    }
    else if (event.getSource() == managerView)
    {
      dispose();
      second = new MViewInterface();
      second.setVisible(true);
    }
    else if (event.getSource() == back)
    {
      dispose();
      ini = new iniInterface();
      ini.setVisible(true);
    }
  }

} // class
